module.exports = function(grunt) {
  grunt.initConfig({
    less: {
      development: {
        options: {
          compress: true,
          yuicompress: true,
          optimization: 2
        },
        files: {
          // target.css file: source.less file
          "css/style.css": "css/*.less"
        }
      }
    },
    validation: {
		options: {
			reset: grunt.option('reset') || false,
			stoponerror: false,
			relaxerror: ['Bad value X-UA-Compatible for attribute http-equiv on element meta.'] //ignores these errors
		},
		files: {
			src: ['index.html']
		}
    },
	
	jshint: {
		all: ['Gruntfile.js', 'js/**/*.js', 'js/*.js']
    },
	
	jscs: {
		src: "js/*.js",
		options: {
			config: ".jscs.json",
			requireCurlyBraces: [ "if" ]
		}
	}, 
    watch: {
      styles: {
        // Which files to watch (all .less files recursively in the less directory)
        files: ['css/*.less'],
        tasks: ['less']
      },
	  html: {
		files: ['*.html'],
		tasks: ['validation']
      }
    }
  });
 
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-html-validation');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks("grunt-jscs-checker");
  grunt.loadNpmTasks('grunt-contrib-watch');
 
  grunt.registerTask('default', ['less', 'validation', 'watch']);
};